import {post, put} from "../../utils/req";
import {alert} from "../../components/common/alert";

export const uploadImage = async (data) => {
    try {
        return await put('/private/upload', data)
    } catch (err) {
        alert(`上传图片失败：${err}`, "error");
        return null
    }
}

export const query = async (data) => {
    try {
        return await post('/private/rt/query', data)
    } catch (err) {
        alert(`获取内容失败：${err}`, "error");
        return null;
    }
}
export const save = async (data) => {
    try {
        await post('/private/rt/save', data)
        alert('保存内容成功');
        return true;
    } catch (err) {
        alert(`保存内容失败：${err}`, "error");
        return false;
    }
}
